package org.mat.ipaas.ucenter.service.api.message;

import org.mat.framework.lang.dto.MatApiResponse;
import org.mat.ipaas.ucenter.service.dto.message.entity.MsgParamsDTO;
import org.mat.ipaas.ucenter.service.dto.message.entity.SysMessageTemplateDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 消息模板
 * @Sate: 2019-04-09
 * @Version: V1.0
 */
@FeignClient(name = "mat-ipaas-ucenter-service",contextId = "sys-message-template-rest-api")
public interface SysMessageTemplateRestAPI {

    /**
     * 分页列表查询
     *
     * @param sysMessageTemplateDTO
     * @param pageNo
     * @param pageSize
     * @return
     */
    @GetMapping(value = "/sys/message/sysMessageTemplate/list")
    MatApiResponse<?> queryPageList(@SpringQueryMap SysMessageTemplateDTO sysMessageTemplateDTO,
                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize);

    /**
     * 添加
     *
     * @param sysMessageTemplateDTO
     * @return
     */
    @PostMapping(value = "/sys/message/sysMessageTemplate/add")
    MatApiResponse<?> add(@RequestBody SysMessageTemplateDTO sysMessageTemplateDTO);

    /**
     * 编辑
     *
     * @param sysMessageTemplateDTO
     * @return
     */
    @PutMapping(value = "/sys/message/sysMessageTemplate/edit")
    MatApiResponse<?> edit(@RequestBody SysMessageTemplateDTO sysMessageTemplateDTO);

    /**
     * 通过id删除
     *
     * @param id
     * @return
     */
    @DeleteMapping(value = "/sys/message/sysMessageTemplate/delete")
    MatApiResponse<?> delete(@RequestParam(name = "id", required = true) String id);

    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    @DeleteMapping(value = "/sys/message/sysMessageTemplate/deleteBatch")
    MatApiResponse<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids);

    /**
     * 通过id查询
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/sys/message/sysMessageTemplate/queryById")
    MatApiResponse<?> queryById(@RequestParam(name = "id", required = true) String id);

    /**
     * 导出excel
     *
     * 
     */
    @GetMapping(value = "/sys/message/sysMessageTemplate/exportXls")
    ModelAndView exportXls( SysMessageTemplateDTO sysMessageTemplateDTO);

    /**
     * excel导入
     *
     * 
     * 
     * @return
     */
    @PostMapping(value = "/sys/message/sysMessageTemplate/importExcel")
    MatApiResponse<?> importExcel( );

    /**
     * 发送消息
     */
    @PostMapping(value = "/sys/message/sysMessageTemplate/sendMsg")
    MatApiResponse<SysMessageTemplateDTO> sendMessage(@RequestBody MsgParamsDTO msgParamsDTO);
}
